// 百度地图API功能
var map = new BMap.Map("m_mid");
var point = new BMap.Point(119.322686,31.720715);
var marker = new BMap.Marker(new BMap.Point(119.322686, 31.720715));
map.addControl(new BMap.MapTypeControl());   //添加地图类型控件
map.centerAndZoom(point, 13);
map.enableScrollWheelZoom(true);     //开启鼠标滚轮缩放
var opts = {
    width: 300,     // 信息窗口宽度
    // 信息窗口高度
    // title: "信息窗口", // 信息窗口标题
    enableMessage: true//设置允许信息窗发送短息
};

var data=[
        [119.322686,31.720715],
        [119.325956,31.81969],
        [119.323555,31.788672],
        [119.34542,31.860999]
]

for(var i=0;i<data.length;i++){
    // console.log(data[i][0]+","+data[i][1]);
    var point = new BMap.Point(data[i][0],data[i][1]);
    var sContent=
        "<div class='view_content'style='margin-top: 0px; margin-left: 4px;'>"+
        "<table width='290px'>"+
        "<tr style='height: 30px;'>"+
        "<td width='30%'>执勤点：</td>"+
        "<td><div id='point' style='text-align: left;'><input type='text' name='point' class='placeholder' value='茅山村'></div></td>"+
        "</tr>"+
        "<tr style='height: 30px;'>"+
        "<td >执勤人员：</td>"+
        "<td><div id='name' style='text-align: left'><input type='text' name='name' class='placeholder' value='张三'></div></td>"+
        "</tr>"+
        "<tr style='height: 30px;'>"+
        "<td >联系方式：</td>"+
        "<td><div id='mobile' style='text-align: left'><input type='text' name='mobile' class='placeholder' value='18000000000'></div></td>"+
        "</tr>"+
        "<tr style='height: 30px;'>"+
        "<td >执勤时间：</td>"+
        "<td><div id='time' style='text-align: left'><input type='text' name='time' class='placeholder' value='2017/9/19'></div></td>"+
        "</tr>"+
        "</table>"+
        "</div>"+
        "<div>"+
        "<button style='width: 60px; height: 30px; background-color: #ED2D2D; color: white; border: none; cursor: pointer; float: right; margin-right: 20px; margin-top: 5px;'>提交</button>"+
        "</div>";
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
        marker.disableDragging();
        addClickHandler(sContent,marker);
    }
function addClickHandler(content, marker) {
    marker.addEventListener("click", function (e) {
            openInfo(content, e)
        }
    );
}

function openInfo(content, e) {
    var p = e.target;
    var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
    var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
    map.openInfoWindow(infoWindow, point); //开启信息窗口
    // console.log(point);
}

var navigationControl = new BMap.NavigationControl({
    // 靠左上角位置
    anchor: BMAP_ANCHOR_TOP_LEFT,
    // LARGE类型
    type: BMAP_NAVIGATION_CONTROL_LARGE,
    // 启用显示定位
    enableGeolocation: true
});
map.addControl(navigationControl);


// 添加定位控件
var geolocationControl = new BMap.GeolocationControl();
geolocationControl.addEventListener("locationSuccess", function(e){
    // 定位成功事件
    var address = '';
    address += e.addressComponent.province;
    address += e.addressComponent.city;
    address += e.addressComponent.district;
    address += e.addressComponent.street;
    address += e.addressComponent.streetNumber;
    alert("当前定位地址为：" + address);
});
geolocationControl.addEventListener("locationError",function(e){
    // 定位失败事件
    alert(e.message);
});
map.addControl(geolocationControl);


var polygon = new BMap.Polygon([
    new BMap.Point(119.338414,31.909236),new BMap.Point(119.338414,31.907603),new BMap.Point(119.336497,31.906132),new BMap.Point(119.339182,31.905313),new BMap.Point(119.338989,31.903351),new BMap.Point(119.343206,31.903189),new BMap.Point(119.344545,31.90286),new BMap.Point(119.348955,31.903841),new BMap.Point(119.350487,31.902698),new BMap.Point(119.349337,31.899427),new BMap.Point(119.349337,31.897629),new BMap.Point(119.349912,31.896158),new BMap.Point(119.34723,31.89387),new BMap.Point(119.344738,31.892069),new BMap.Point(119.344931,31.889781),new BMap.Point(119.346845,31.887983),new BMap.Point(119.350295,31.887328),new BMap.Point(119.34972,31.88504),new BMap.Point(119.34972,31.883239),new BMap.Point(119.349145,31.880787),new BMap.Point(119.349145,31.879643),new BMap.Point(119.34742,31.878498),new BMap.Point(119.346463,31.875716),new BMap.Point(119.34723,31.872611),new BMap.Point(119.347613,31.869829),new BMap.Point(119.349912,31.86754),new BMap.Point(119.351062,31.865906),new BMap.Point(119.351062,31.864434),new BMap.Point(119.348955,31.864598),new BMap.Point(119.34742,31.863617),new BMap.Point(119.34742,31.860999),new BMap.Point(119.346653,31.860018),new BMap.Point(119.345695,31.859201),new BMap.Point(119.345885,31.857893),new BMap.Point(119.344353,31.856911),new BMap.Point(119.342821,31.855766),new BMap.Point(119.341096,31.854293),new BMap.Point(119.340328,31.852004),new BMap.Point(119.340903,31.850125),new BMap.Point(119.341096,31.847342),new BMap.Point(119.340328,31.844397),new BMap.Point(119.342053,31.841126),new BMap.Point(119.340136,31.837691),new BMap.Point(119.338604,31.836382),new BMap.Point(119.334197,31.833764),new BMap.Point(119.331897,31.830163),new BMap.Point(119.328255,31.825746),new BMap.Point(119.325956,31.81969),new BMap.Point(119.325381,31.816907),new BMap.Point(119.323466,31.813144),new BMap.Point(119.320592,31.80807),new BMap.Point(119.321167,31.804633),new BMap.Point(119.322506,31.802504),new BMap.Point(119.325668,31.80234),new BMap.Point(119.32605,31.802831),new BMap.Point(119.325283,31.801274),new BMap.Point(119.324515,31.799966),new BMap.Point(119.325858,31.798984),new BMap.Point(119.325665,31.795546),new BMap.Point(119.325665,31.791618),new BMap.Point(119.325855,31.790309),new BMap.Point(119.323555,31.788672),new BMap.Point(119.320873,31.783925),new BMap.Point(119.320106,31.782287),new BMap.Point(119.317231,31.782452),new BMap.Point(119.315314,31.78147),new BMap.Point(119.313014,31.778687),new BMap.Point(119.3111,31.774594),new BMap.Point(119.30995,31.769846),new BMap.Point(119.308607,31.766244),new BMap.Point(119.308415,31.764441),new BMap.Point(119.311097,31.762967),new BMap.Point(119.312439,31.760349),new BMap.Point(119.313014,31.755107),new BMap.Point(119.314164,31.751668),new BMap.Point(119.31301,31.749372),new BMap.Point(119.31186,31.747571),new BMap.Point(119.31531,31.746915),new BMap.Point(119.31416,31.745606),new BMap.Point(119.315499,31.744623),new BMap.Point(119.31186,31.743967),new BMap.Point(119.310135,31.743314),new BMap.Point(119.3109,31.740201),new BMap.Point(119.312242,31.737909),new BMap.Point(119.315499,31.737909),new BMap.Point(119.317414,31.735125),new BMap.Point(119.318756,31.733814),new BMap.Point(119.325655,31.7366),new BMap.Point(119.32853,31.736764),new BMap.Point(119.332074,31.735781),new BMap.Point(119.333417,31.732506),new BMap.Point(119.333417,31.730049),new BMap.Point(119.333224,31.72661),new BMap.Point(119.332459,31.724317),new BMap.Point(119.328817,31.724971),new BMap.Point(119.326518,31.724153),new BMap.Point(119.322686,31.720715),new BMap.Point(119.322878,31.718584),new BMap.Point(119.322878,31.71498),new BMap.Point(119.322303,31.711377),new BMap.Point(119.324603,31.709411),new BMap.Point(119.329585,31.708593),new BMap.Point(119.329585,31.706953),new BMap.Point(119.32767,31.70466),new BMap.Point(119.326328,31.701055),new BMap.Point(119.325753,31.696796),new BMap.Point(119.325371,31.692207),new BMap.Point(119.323071,31.689341),new BMap.Point(119.320389,31.685899),new BMap.Point(119.316939,31.680329),new BMap.Point(119.316365,31.678197),new BMap.Point(119.316365,31.676231),new BMap.Point(119.31349,31.674591),new BMap.Point(119.310233,31.672624),new BMap.Point(119.308316,31.671968),new BMap.Point(119.305441,31.670166),new BMap.Point(119.305249,31.667053),new BMap.Point(119.302374,31.667215),new BMap.Point(119.298542,31.665413),new BMap.Point(119.297392,31.663119),new BMap.Point(119.297392,31.659839),new BMap.Point(119.295093,31.658528),new BMap.Point(119.292218,31.656561),new BMap.Point(119.287811,31.654432),new BMap.Point(119.284552,31.652627),new BMap.Point(119.280145,31.649841),new BMap.Point(119.272864,31.646725),new BMap.Point(119.268454,31.64443),new BMap.Point(119.266154,31.641971),new BMap.Point(119.264815,31.644103),new BMap.Point(119.262897,31.643776),new BMap.Point(119.261365,31.645252),new BMap.Point(119.260023,31.643447),new BMap.Point(119.258491,31.646398),new BMap.Point(119.258876,31.649676),new BMap.Point(119.256576,31.648692),new BMap.Point(119.252934,31.6482),new BMap.Point(119.248335,31.647709),new BMap.Point(119.24872,31.651643),new BMap.Point(119.24546,31.657707),new BMap.Point(119.242203,31.65902),new BMap.Point(119.239521,31.657545),new BMap.Point(119.240861,31.661149),new BMap.Point(119.238946,31.66574),new BMap.Point(119.236647,31.669347),new BMap.Point(119.233772,31.673116),new BMap.Point(119.235307,31.677379),new BMap.Point(119.238372,31.68082),new BMap.Point(119.239332,31.683279),new BMap.Point(119.239332,31.685899),new BMap.Point(119.238564,31.687866),new BMap.Point(119.239714,31.689341),new BMap.Point(119.243931,31.689341),new BMap.Point(119.246231,31.690653),new BMap.Point(119.252362,31.688687),new BMap.Point(119.256102,31.688849),new BMap.Point(119.257441,31.692128),new BMap.Point(119.258209,31.696552),new BMap.Point(119.255527,31.702942),new BMap.Point(119.255717,31.707037),new BMap.Point(119.258402,31.710642),new BMap.Point(119.263768,31.710642),new BMap.Point(119.266261,31.709495),new BMap.Point(119.269903,31.712281),new BMap.Point(119.271628,31.715722),new BMap.Point(119.274884,31.715886),new BMap.Point(119.274022,31.712937),new BMap.Point(119.276707,31.711463),new BMap.Point(119.280539,31.711628),new BMap.Point(119.285138,31.712773),new BMap.Point(119.287245,31.714739),new BMap.Point(119.290695,31.719327),new BMap.Point(119.292227,31.719983),new BMap.Point(119.296251,31.719),new BMap.Point(119.298743,31.72113),new BMap.Point(119.296636,31.72457),new BMap.Point(119.292805,31.723587),new BMap.Point(119.28782,31.722767),new BMap.Point(119.28667,31.725388),new BMap.Point(119.287245,31.726863),new BMap.Point(119.28667,31.727519),new BMap.Point(119.289352,31.730138),new BMap.Point(119.293569,31.729976),new BMap.Point(119.297019,31.729976),new BMap.Point(119.298551,31.73145),new BMap.Point(119.295487,31.731612),new BMap.Point(119.295869,31.733578),new BMap.Point(119.297211,31.735052),new BMap.Point(119.292037,31.735052),new BMap.Point(119.286863,31.733904),new BMap.Point(119.282646,31.732595),new BMap.Point(119.276704,31.73456),new BMap.Point(119.270573,31.738656),new BMap.Point(119.267505,31.745864),new BMap.Point(119.263674,31.750939),new BMap.Point(119.26923,31.75536),new BMap.Point(119.263099,31.759128),new BMap.Point(119.258882,31.763549),new BMap.Point(119.258499,31.76797),new BMap.Point(119.255817,31.771082),new BMap.Point(119.252943,31.775993),new BMap.Point(119.250643,31.777467),new BMap.Point(119.248151,31.777467),new BMap.Point(119.250261,31.782214),new BMap.Point(119.250451,31.787454),new BMap.Point(119.2516,31.790562),new BMap.Point(119.249876,31.794329),new BMap.Point(119.249876,31.797275),new BMap.Point(119.254282,31.80055),new BMap.Point(119.258307,31.797113),new BMap.Point(119.257157,31.801532),new BMap.Point(119.253707,31.80546),new BMap.Point(119.258114,31.806933),new BMap.Point(119.263288,31.805787),new BMap.Point(119.263099,31.81986),new BMap.Point(119.267505,31.820189),new BMap.Point(119.265013,31.824116),new BMap.Point(119.259457,31.826241),new BMap.Point(119.255625,31.828205),new BMap.Point(119.25294,31.831315),new BMap.Point(119.25294,31.834915),new BMap.Point(119.252558,31.836714),new BMap.Point(119.251215,31.837367),new BMap.Point(119.252558,31.838513),new BMap.Point(119.254282,31.836957),new BMap.Point(119.258117,31.837121),new BMap.Point(119.263484,31.842029),new BMap.Point(119.265398,31.840719),new BMap.Point(119.267313,31.837121),new BMap.Point(119.273062,31.842846),new BMap.Point(119.279771,31.844154),new BMap.Point(119.288395,31.852826),new BMap.Point(119.288588,31.854134),new BMap.Point(119.291077,31.854708),new BMap.Point(119.295676,31.857817),new BMap.Point(119.296826,31.858308),new BMap.Point(119.301425,31.85896),new BMap.Point(119.304107,31.857326),new BMap.Point(119.30823,31.855199),new BMap.Point(119.312061,31.856259),new BMap.Point(119.315416,31.855358),new BMap.Point(119.316948,31.856666),new BMap.Point(119.320398,31.858955),new BMap.Point(119.321165,31.861738),new BMap.Point(119.317811,31.861899),new BMap.Point(119.314746,31.863862),new BMap.Point(119.314746,31.868769),new BMap.Point(119.315896,31.872203),new BMap.Point(119.31896,31.874983),new BMap.Point(119.317621,31.876619),new BMap.Point(119.314746,31.876128),new BMap.Point(119.315511,31.878255),new BMap.Point(119.317046,31.88087),new BMap.Point(119.319731,31.879889),new BMap.Point(119.321645,31.881361),new BMap.Point(119.322985,31.881361),new BMap.Point(119.322985,31.884959),new BMap.Point(119.321835,31.887902),new BMap.Point(119.32356,31.891662),new BMap.Point(119.327202,31.898691),new BMap.Point(119.329501,31.902453),new BMap.Point(119.334486,31.906541),new BMap.Point(119.334486,31.906541),new BMap.Point(119.336211,31.908829),
], {strokeColor:"blue", fillColor:"blue", strokeWeight:2, strokeOpacity:0.5});  //创建多边形

// //添加覆盖物
// function add_overlay() {
//     map.addOverlay(polygon);           //增加多边形
// }
//
// //清除覆盖物
// function remove_overlay(){
//     map.clearOverlays();
// }

function ionload() {
     map.addOverlay(polygon);
}
polygon.addEventListener("click",overlay_style);

function overlay_style(e) {
    var p=e.target;
    // if(p instanceof BMap.polygon){
    //      alert("该覆盖物是多边形");
    // }
    iAlert();
}

// function  showInfo(e) {
//     // alert(e.point.lng+","+e.point.lat)
//     var point=new BMap.Point(e.point.lng,e.point.lat);
//     var marker=new BMap.Marker(point);
//     map.addOverlay(marker);
// }
// map.addEventListener("click", showInfo);

function ipeople() {
    function  showInfo(e) {
        // alert(e.point.lng+","+e.point.lat)
        var point=new BMap.Point(e.point.lng,e.point.lat);
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
    }
    map.addEventListener("click", showInfo);
}

function scenic() {
    map.clearOverlays(marker);
    map.addOverlay(polygon);
    var data=[
        [119.349145,31.880787],
        [119.338989,31.903351],
        [119.323595,31.888872],
        [119.315314,31.78147]
    ]
    for(var i=0;i<data.length;i++){
        // console.log(data[i][0]+","+data[i][1]);
        var point = new BMap.Point(data[i][0],data[i][1]);
        var sContent=
            "<div class='view_content'style='margin-top: 0px; margin-left: 4px;'>"+
            "<table width='290px'>"+
            "<tr style='height: 30px;'>"+
            "<td width='30%'>执勤点：</td>"+
            "<td><div id='point' style='text-align: left;'><input type='text' name='point' class='placeholder' value='茅山村'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >执勤人员：</td>"+
            "<td><div id='name' style='text-align: left'><input type='text' name='name' class='placeholder' value='张三'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >联系方式：</td>"+
            "<td><div id='mobile' style='text-align: left'><input type='text' name='mobile' class='placeholder' value='18000000000'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >执勤时间：</td>"+
            "<td><div id='time' style='text-align: left'><input type='text' name='time' class='placeholder' value='2017/9/19'></div></td>"+
            "</tr>"+
            "</table>"+
            "</div>"+
            "<div>"+
            "<button style='width: 60px; height: 30px; background-color: #ED2D2D; color: white; border: none; cursor: pointer; float: right; margin-right: 20px; margin-top: 5px;'>提交</button>"+
            "</div>";
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
        marker.disableDragging();
        addClickHandler(sContent,marker);
    }
    function addClickHandler(content, marker) {
        marker.addEventListener("click", function (e) {
                openInfo(content, e)
            }
        );
    }

    function openInfo(content, e) {
        var p = e.target;
        var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
        var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow, point); //开启信息窗口
        // console.log(point);
    }

}

function iplace() {
    map.clearOverlays(marker);
    map.addOverlay(polygon);
    var data=[
        [119.349145,31.880787],
        [119.338989,31.903351],
        [119.323595,31.888872],
        [119.31416,31.745606],
        [119.316948,31.856666],
        [119.325858,31.798984],
        [119.252934,31.6482],
        [119.274884,31.715886],
        [119.334486,31.906541]
    ]
    for(var i=0;i<data.length;i++){
        // console.log(data[i][0]+","+data[i][1]);
        var point = new BMap.Point(data[i][0],data[i][1]);
        var sContent=
            "<div class='view_content'style='margin-top: 0px; margin-left: 4px;'>"+
            "<table width='290px'>"+
            "<tr style='height: 30px;'>"+
            "<td width='30%'>名称：</td>"+
            "<td><div id='name' style='text-align: left;'><input type='text' name='name' class='placeholder' value='某某场所'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >地址：</td>"+
            "<td><div id='address' style='text-align: left'><input type='text' name='address' class='placeholder' value='茅山村1号'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >类别：</td>"+
            "<td><div id='nature' style='text-align: left'><input type='text' name='nature' class='placeholder' value='旅馆业'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >负责人：</td>"+
            "<td><div id='principal' style='text-align: left'><input type='text' name='principal' class='placeholder' value='王五'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >联系方式：</td>"+
            "<td><div id='mobile' style='text-align: left'><input type='text' name='mobile' class='placeholder' value='18000000000'></div></td>"+
            "</tr>"+
            "</table>"+
            "</div>"+
            "<div>"+
            "<button style='width: 60px; height: 30px; background-color: #ED2D2D; color: white; border: none; cursor: pointer; float: right; margin-right: 20px; margin-top: 5px;'>提交</button>"+
            "</div>";
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
        marker.disableDragging();
        addClickHandler(sContent,marker);
    }
    function addClickHandler(content, marker) {
        marker.addEventListener("click", function (e) {
                openInfo(content, e)
            }
        );
    }

    function openInfo(content, e) {
        var p = e.target;
        var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
        var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow, point); //开启信息窗口
        // console.log(point);
    }
    
}

function icompany() {
    map.clearOverlays(marker);
    map.addOverlay(polygon);
    var data=[
        [119.31416,31.745606],
        [119.338989,31.903351],
        [119.323595,31.888872],
        [119.31416,31.745606],
        [119.316948,31.856666],
        [119.325858,31.798984],
        [119.34723,31.872611],
        [119.34742,31.878498],
        [119.334486,31.906541]
    ]
    for(var i=0;i<data.length;i++){
        // console.log(data[i][0]+","+data[i][1]);
        var point = new BMap.Point(data[i][0],data[i][1]);
        var sContent=
            "<div class='view_content'style='margin-top: 0px; margin-left: 4px;'>"+
            "<table width='290px'>"+
            "<tr style='height: 30px;'>"+
            "<td width='30%'>企业名称：</td>"+
            "<td><div id='name' style='text-align: left;'><input type='text' name='name' class='placeholder' value='某某企业'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >企业地址：</td>"+
            "<td><div id='address' style='text-align: left'><input type='text' name='address' class='placeholder' value='茅山村解放路12号'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >类别：</td>"+
            "<td><div id='nature' style='text-align: left'><input type='text' name='nature' class='placeholder' value='制造业'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >负责人：</td>"+
            "<td><div id='principal' style='text-align: left'><input type='text' name='principal' class='placeholder' value='赵六'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >联系方式：</td>"+
            "<td><div id='mobile' style='text-align: left'><input type='text' name='mobile' class='placeholder' value='18000000008'></div></td>"+
            "</tr>"+
            "</table>"+
            "</div>"+
            "<div>"+
            "<button style='width: 60px; height: 30px; background-color: #ED2D2D; color: white; border: none; cursor: pointer; float: right; margin-right: 20px; margin-top: 5px;'>提交</button>"+
            "</div>";
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
        marker.disableDragging();
        addClickHandler(sContent,marker);
    }
    function addClickHandler(content, marker) {
        marker.addEventListener("click", function (e) {
                openInfo(content, e)
            }
        );
    }

    function openInfo(content, e) {
        var p = e.target;
        var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
        var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow, point); //开启信息窗口
        // console.log(point);
    }
}

function crowd() {
    map.clearOverlays(marker);
    map.addOverlay(polygon);
    var data=[
        [119.233772,31.673116],
        [119.324515,31.799966],
        [119.323595,31.888872],
        [119.258117,31.837121]
    ]
    for(var i=0;i<data.length;i++){
        // console.log(data[i][0]+","+data[i][1]);
        var point = new BMap.Point(data[i][0],data[i][1]);
        var sContent=
            "<div class='view_content'style='margin-top: 0px; margin-left: 4px;'>"+
            "<table width='290px'>"+
            "<tr style='height: 30px;'>"+
            "<td width='30%'>姓名：</td>"+
            "<td><div id='name' style='text-align: left;'><input type='text' name='name' class='placeholder' value='李四'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >类别：</td>"+
            "<td><div id='category' style='text-align: left'><input type='text' name='category' class='placeholder' value='社区矫正'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >联系方式：</td>"+
            "<td><div id='mobile' style='text-align: left'><input type='text' name='mobile' class='placeholder' value='18000000005'></div></td>"+
            "</tr>"+
            "<tr style='height: 30px;'>"+
            "<td >住址：</td>"+
            "<td><div id='address' style='text-align: left'><input type='text' name='address' class='placeholder' value='茅山村人民路2号'></div></td>"+
            "</tr>"+
            "</table>"+
            "</div>"+
            "<div>"+
            "<button style='width: 60px; height: 30px; background-color: #ED2D2D; color: white; border: none; cursor: pointer; float: right; margin-right: 20px; margin-top: 5px;'>提交</button>"+
            "</div>";
        var marker=new BMap.Marker(point);
        map.addOverlay(marker);
        marker.disableDragging();
        addClickHandler(sContent,marker);
    }
    function addClickHandler(content, marker) {
        marker.addEventListener("click", function (e) {
                openInfo(content, e)
            }
        );
    }

    function openInfo(content, e) {
        var p = e.target;
        var point = new BMap.Point(p.getPosition().lng, p.getPosition().lat);
        var infoWindow = new BMap.InfoWindow(content, opts);  // 创建信息窗口对象
        map.openInfoWindow(infoWindow, point); //开启信息窗口
    }

}